(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  this.SendMessageView = (function(_super) {

    __extends(SendMessageView, _super);

    function SendMessageView() {
      return SendMessageView.__super__.constructor.apply(this, arguments);
    }

    SendMessageView.prototype.popUpId = "send-message";

    SendMessageView.prototype.title = "Send message";

    SendMessageView.prototype.height = 250;

    SendMessageView.prototype.width = 480;

    SendMessageView.prototype.initialize = function() {
      SendMessageView.__super__.initialize.apply(this, arguments);
      return this.render();
    };

    SendMessageView.prototype.render = function() {
      var _this = this;
      return this.GetTemplate(SiteMap.Messages.SendMessageTemplate, function(compiledTemplate) {
        return $(_this.el).html(compiledTemplate(_this.model.toJSON()));
      });
    };

    SendMessageView.prototype.events = {
      "click button.send": "sendMessage"
    };

    SendMessageView.prototype.sendMessage = function(e) {
      var message;
      e.preventDefault();
      message = $(e.target).closest("form").find("fieldset input[type='text']").val();
      this.model.set("Message", message, {
        silent: true
      });
      return this.model.fetch();
    };

    return SendMessageView;

  })(PopUpView);

}).call(this);
